# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=voipong
pkgver=2.0
pkgrel=4
pkgdesc='A utility which detects all Voice Over IP calls on a pipeline, and for those which are G711 encoded, dumps actual conversation to separate wave files.'
arch=('x86_64' 'aarch64')
url='http://www.enderunix.org/voipong/'
license=('GPL')
groups=('blackarch' 'blackarch-voip')
depends=('libpcap')
source=("http://www.enderunix.org/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('759828ad45703c153bd16085157dc6c4af5ae22d0b7014d2f2b52d079544ca4fa19bec4d07593e13bdda69e385b2f62d2bdd3d12149ee301dd03822c5d0a66bc')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 $pkgdir/{usr/bin,etc/}

  sed -e "s:/usr/local/etc:/etc:g" -i voipctl.c
  sed -e "s:/usr/local/etc:/etc:g" -i "$pkgname.c"
  sed -e "s:/usr/local/etc:$pkgdir/etc:g" -e "s:/usr/local/:$pkgdir/usr/:g" \
    -i Makefile.linux

  make CFLAGS="$CFLAGS -Iinclude" -f Makefile.linux

  make install -f Makefile.linux
}

